package com.example.textview.datastorage;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.example.textview.R;

public class DataStorageActivity extends AppCompatActivity implements View.OnClickListener{

    Button mbtn_sharedpreference ,mbtn_file;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_data_storage);

        mbtn_sharedpreference=findViewById(R.id.btn_sharedpreference);
        mbtn_sharedpreference.setOnClickListener(this);

        mbtn_file=findViewById(R.id.btn_file);
        mbtn_file.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent=null;
        switch (view.getId())
        {
            case R.id.btn_sharedpreference:
                intent=new Intent(DataStorageActivity.this,SharedPreferenceActivity.class);
                break;

            case R.id.btn_file:
                Log.d("wwwww","qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq");
                intent=new Intent(DataStorageActivity.this,FileActivity.class);
                break;
        }
if(intent!=null)
        startActivity(intent);
    }
}